<%@page import="post.*" %>
<%@page import="category.Utils" %>
<%@page import="yxnote.Category" %>
<%@page import="java.util.List" %>
<%@ include file="/layout/top.jsp" %>
<%
Post p = post.Utils.find(request.getParameter("id"));
%>

<form action="/post/update?id=<%= request.getParameter("id") %>" method="post">
<input type="text" name="title" value="<%= p.getTitle() %>" />
<% List<Category> categorys = category.Utils.find(); %>
<select name="category">
<% for (Category c:categorys) { %>
<option value="<%= c.getKey().getId()%>" <% if (p.getCategory().equals(c.getKey())) { %> selected="selected" <% } %>><%= c.getName() %></option>
<% } %>
</select>
<textarea rows="10" cols="50" name="content"><%= p.getContent().getValue() %></textarea>
<input type="submit" value="Update" />
</form>
<%@ include file="/layout/foot.jsp" %>